<template>
  <div>
    <el-dialog
      title="审核日志"
      :visible.sync="visible"
      width="70%"
      :before-close="handleClose"
    >
      <TableList
        v-if="visible"
        ref="TableList"
        :request-url="'/system/apply/approvalProcess/'+ data.id"
        request-method="post"
        :table-column="tableColumn"
        :has-search="false"
        :header-btn-show="false"
        :table-padding="0"
      >
        <template #applyStatus="{ item, row }">
          <div>{{ {0: '失败', 1: '通过'}[row[item]] }}</div>
        </template>
      </TableList>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    visible: Boolean,
    data: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      tableColumn: [
        {
          prop: 'approvalNode',
          label: '审批节点'
        }, {
          prop: 'approvalRole',
          label: '需要审批角色'
        },
        {
          prop: 'approveUser',
          label: '审批人'
        }, {
          prop: 'applyStatus',
          label: '状态'
        }, {
          prop: 'opinion',
          label: '审核备注'
        }
      ]
    }
  },
  methods: {
    handleClose() {
      console.log('000')
      this.$emit('handleClose')
    }
  }
}
</script>
